package com.itheima.web.controller;


import com.itheima.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//@Controller
//@ResponseBody
@RestController
@RequestMapping("/ajax")
public class AjaxController {

    @RequestMapping("/test1")
    public String test1(@RequestBody String username){

        System.out.println("test1........"+username);

        return username;
    }

    @RequestMapping("/test2")
    public String test2(@RequestBody User user){

        System.out.println(user);

        return "yes/true";
    }


    @RequestMapping("/test3")
    public String test3(User user) {
        System.out.println(user);

        return "manager";
    }

}
